package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//i18n:action怎么进行国际化
@Controller
@RequestMapping("/i18n")
public class I18NController {
    @Autowired
    MessageSource messageSource;
//    @ResponseBody
    @RequestMapping("/demo")
    public String demo(Model model) {
//        return messageSource.getMessage("disk",null,null);

        //页面国际化
        model.addAttribute("name","zhang");
        model.addAttribute("age",21);
        return "i18n_res";
    }
}
